<extend name="Public/base"/>
<block name="head">
	<link href="__CSS__/article.css" rel="stylesheet">
</block>
<block name="body">
	<div class="container" >

        <div class="row">
			{:ad(3,'article_detail_top')}
		</div>
			<!-- 面包屑 -->
		<div class="row" style="margin-top:10px;">
			<ol class="breadcrumb">
			  <li><a href="{:U('Index/index')}">{:C('WEB_SITE_TITLE')}</a></li>
			  <li><a href="{:U('Article/index',array('category'=>$category['id']))}">{$category['title']}</a></li>
			  <li class="active"> {$info['title']}   </li>
			</ol>
        </div>
        <div class="row">
			<div class="col-md-8 article-left">
				<div class="col-md-12 main-title" >
					<h3 class="col-md-12 article-title">{$info.title}</h3>
					<div clas="col-md-12">
						<span class="col-md-6">{$info.create_time|date='Y-m-d H:i:s',###}</span>
						<span class="col-md-6">
							<i class="glyphicon glyphicon-eye-open"></i>
										{$info.view}
							</span>
					</div>
					
				</div>
				
				<div class="col-md-12 main-content">
					
					<img class="img-responsive" src="{$info.cover_id|get_cover=path}" alt="{$info.title}">
					<section id="contents">{:get_tag_url($info['id'],$info['content'])}</section>
				</div>
				<div class="bdsharebuttonbox col-md-12" data-tag="share_1">
					<ul class="col-md-6 post-info">
						<li class="info-item">
							<i class="glyphicon glyphicon-eye-open"></i>
							<span>{$info.view}</span>			
						</li>
						<li class="info-item">
							<i class="info-icon icon-like" data-id="{$info.id}"></i>
							<span>{$info.favor}</span>			
						</li>
						<li class="info-item">
							<i class="info-icon icon-comment"></i>
							<span>{$info.comment}</span>
						</li>
						<li class="info-item">
							<i class="info-icon icon-share"></i>
							<span class="bds_count" data-cmd="count"></span>
						</li>
						
					</ul>
					<div class="ke-shares col-md-6" >
						<span>分享到</span>
						<a class="share-icon icon-weixin" href="{:U('Share/share',array('share_id'=>'weixin','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
						<a class="share-icon icon-qzone" href="{:U('Share/share',array('share_id'=>'qzone','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
						<a class="share-icon icon-tsina" href="{:U('Share/share',array('share_id'=>'tsina','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
						<a class="share-icon icon-sqq" href="{:U('Share/share',array('share_id'=>'cqq','type'=>'article','id'=>$info['id']));}" target="_blank"></a>
					</div>
					{:hook('documentDetailAfter',$info)}
				</div>
				<div class="col-md-12">
					<notempty name="info.tag">
					<p class="tags">
						<em>继续阅读：</em>
						<volist name="info.tag" id="vo">
							<a class="content_tag label label-info" href="{:U('Article/tag',array('id'=>$vo['id']))}">{$vo.tag_name}</a>
						</volist>
					</p>
					</notempty>
				</div>
				<div class="col-md-12 comment">
					<h5>评论</h5>
					<ul>
						<notempty name="comment_list">
							<volist name="comment_list" id="vo">
							<li class="comment-cell col-md-12">
								<div class="comment-user col-md-2">
									<div class="avatar">
										<notempty name="vo.avatar">
										<img alt="{$vo.nickname}" src="{$vo.avatar}">
										<else/>
											<img alt="{$vo.nickname}" src="__IMG__/headicon_128.png">
										</notempty>
									</div>
									<div class="user">{$vo.nickname}</div>
								</div>
								<div class="comment-body col-md-10">
									<div class="comment-content col-md-12">
										{$vo.content}
									</div>
									<div class="comment-operate col-md-12">
										<div class="create-time">{$vo.create_time|date='Y-m-d H:i:s',###}</div>
									</div>
								</div>
							</li>
							</volist>
						</notempty>
					</ul>
				</div>
				<div class="col-md-10 col-md-offset-2 ">
					<form class="form-horizontal" action="{:U('Article/comment')}">
						<textarea class="form-control" name="content" rows="3"></textarea>
						<input type="hidden" name="object_id" value="{$info['id']}">
						<button class="ajax-post btn btn-success fr" style="margin-top:20px;" type="submit" target-form="form-horizontal">提交评论</button>
					</form>
				</div>
				

			</div>
			<div class="col-md-4 article-right">
				<div class="news-label col-md-12" >
					<h5>推荐文章</h5>
				</div>
				<div class="news-label col-md-12">
					<ul class="col-md-12 new-list"">
					<volist name="recommend_article['detail']" id="data">
						
							<li class="list-unstyled">
								<i class="circle <if condition='$i lt 4'> circle-active</if>">{$i}</i>
								<a href="{:U('Article/detail?id='.$data['id'])}">{$data.title}</a>
							</li>
	
					</volist>
					
				</ul>
				</div>
			
				<div class="news-label col-md-12" >
					<h5>最近更新</h5>
				</div>
				<div class="news-label col-md-12">
					
					<ul class="col-md-12 new-list">
					<volist name="news" id="list">					
						<li class="list-unstyled">
							<i class="circle  <if condition='$i lt 4'> circle-active</if>">{$i}</i>
							<a href="{:U('Article/detail?id='.$list['id'])}">{$list.title}</a>
						</li>
					</volist>
					
				</ul>
				</div>
			</div>
           
        </div>
    </div>
    <script>
    	showGoodsImgInArticle = "{:C('SHOW_GOODS_IMG_IN_ARTICLE')}";
    	var img = '';
    	var article = "{$info['id']}";
    	$(function(){
    		$('#contents').find('img').each(function(){
    			$(this).addClass('img-responsive');
    		});
    		$('#contents').find('.article-goods').each(function(){
    			var id = $(this).attr('name');
    			var p  = $(this).parent();
    			
    			if(id!='' && id!='undefinded'){
    				$.post("{:U('Goods/buttonInfo')}", {'id':id,'article':article}, function (result) { 
        				if(result.errno <=0){
        					goods = result.content;
        					var title = '<h3 class= "goods-title">'+goods.name+'</h3>'
        					if(showGoodsImgInArticle >0){
        						img = '<img class="img-responsive goods-img" src="'+goods.src+'">';
        					}
        					var description ='<h5 class="goods-description">'+goods.description+'<h5>';
        					var div = title+description+img+'<div>'+'<span class="price">￥:'+goods.price+'</span>'+'<a class="btn btn-circle" href="'+goods.url+'"><span>查看详细</span></a>'+'</div>';
        					p.html(div);
        					p.addClass('goods-extend');
        				}else{
        					p.remove();
        				}
        			},'json');
    			}
    			
    		});
    	});

    </script>
</block>

